<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Benchmark - benchmark running times of Perl code - Perldoc Browser</title>
    <link rel="search" href="https://perldoc.perl.org/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser">
    <link rel="canonical" href="https://perldoc.perl.org/Benchmark">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" />
    <style>
      body {
        background: #f4f4f5;
        color: #020202;
      }
      .navbar-dark {
        background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0);
        background-repeat: repeat-x;
      }
      .navbar-dark .navbar-nav .nav-link,
      .navbar-dark .navbar-nav .nav-link:focus { color: #fff }
      .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 }
      #wrapperlicious {
        margin: 0 auto;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
        padding: 0;
      }
      #wrapperlicious h1 { font-size: 1.5em }
      #wrapperlicious h2 { font-size: 1.3em }
      #wrapperlicious h3 { font-size: 1.1em }
      #wrapperlicious h4 { font-size: 0.9em }
      #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3,
      #wrapperlicious h4, #wrapperlicious dt {
        color: #020202;
        margin-top: 1em;
        margin-bottom: 1em;
        position: relative;
        font-weight: bold;
      }
      #wrapperlicious a { color: inherit; text-decoration: underline }
      #wrapperlicious #toc { text-decoration: none }
      #wrapperlicious a:hover { color: #2a2a2a }
      #wrapperlicious a img { border: 0 }
      #wrapperlicious :not(pre) > code {
        color: inherit;
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 3px;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        padding: 0.3em;
      }
      #wrapperlicious dd {
        margin: 0;
        margin-left: 2em;
      }
      #wrapperlicious dt {
        color: #2a2a2a;
        font-weight: bold;
        margin-left: 0.9em;
      }
      #wrapperlicious p {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious li > p {
        margin-bottom: 0;
        margin-top: 0;
      }
      #wrapperlicious pre {
        border: 1px solid #c1c1c1;
        border-radius: 3px;
        font: 100% Consolas, Menlo, Monaco, monospace;
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious pre > code {
        display: block;
        background-color: #f6f6f6;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        line-height: 1.5em;
        text-align: left;
        white-space: pre;
        padding: 1em;
      }
      #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious ul {
        list-style-type: square;
      }
      #wrapperlicious ul ul {
        margin-bottom: 0px;
        margin-top: 0px;
      }
      #footer {
        font-size: 0.8em;
        padding-top: 0.5em;
        text-align: center;
      }
      #more {
        display: inline;
        font-size: 0.8em;
      }
      #perldocdiv {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        margin-left: auto;
        margin-right: auto;
        padding: 3em;
        padding-top: 1em;
        max-width: 960px;
      }
      #moduleversion { float: right }
      #wrapperlicious .leading-notice {
        font-style: italic;
        padding-left: 1em;
        margin-top: 1em;
        margin-bottom: 1em;
      }
      #wrapperlicious .permalink {
        display: none;
        left: -0.75em;
        position: absolute;
        padding-right: 0.25em;
        text-decoration: none;
      }
      #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink,
      #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink,
      #wrapperlicious dt:hover .permalink {
        display: block;
      }
    </style>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-KVNWBNT5FB');
      gtag('config', 'UA-50555-3');
    </script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="https://perldoc.perl.org/">Perldoc Browser</a>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="Benchmark.html#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.35.0</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-stable">
          <a class="dropdown-item" href="https://perldoc.perl.org/Benchmark">Latest</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.2/Benchmark">5.38.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.1/Benchmark">5.38.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0/Benchmark">5.38.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.3/Benchmark">5.36.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.2/Benchmark">5.36.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.1/Benchmark">5.36.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.0/Benchmark">5.36.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.3/Benchmark">5.34.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.2/Benchmark">5.34.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.1/Benchmark">5.34.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.0/Benchmark">5.34.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.1/Benchmark">5.32.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.0/Benchmark">5.32.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.3/Benchmark">5.30.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.2/Benchmark">5.30.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.1/Benchmark">5.30.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.0/Benchmark">5.30.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.3/Benchmark">5.28.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.2/Benchmark">5.28.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.1/Benchmark">5.28.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.0/Benchmark">5.28.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.3/Benchmark">5.26.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.2/Benchmark">5.26.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.1/Benchmark">5.26.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.0/Benchmark">5.26.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.4/Benchmark">5.24.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.3/Benchmark">5.24.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.2/Benchmark">5.24.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.1/Benchmark">5.24.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.0/Benchmark">5.24.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.4/Benchmark">5.22.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.3/Benchmark">5.22.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.2/Benchmark">5.22.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.1/Benchmark">5.22.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.0/Benchmark">5.22.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.3/Benchmark">5.20.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.2/Benchmark">5.20.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.1/Benchmark">5.20.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.0/Benchmark">5.20.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.4/Benchmark">5.18.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.3/Benchmark">5.18.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.2/Benchmark">5.18.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.1/Benchmark">5.18.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.0/Benchmark">5.18.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.3/Benchmark">5.16.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.2/Benchmark">5.16.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.1/Benchmark">5.16.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.0/Benchmark">5.16.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.4/Benchmark">5.14.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.3/Benchmark">5.14.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.2/Benchmark">5.14.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.1/Benchmark">5.14.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.0/Benchmark">5.14.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.5/Benchmark">5.12.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.4/Benchmark">5.12.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.3/Benchmark">5.12.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.2/Benchmark">5.12.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.1/Benchmark">5.12.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.0/Benchmark">5.12.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.1/Benchmark">5.10.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.0/Benchmark">5.10.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.9/Benchmark">5.8.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.8/Benchmark">5.8.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.7/Benchmark">5.8.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.6/Benchmark">5.8.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.5/Benchmark">5.8.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.4/Benchmark">5.8.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.3/Benchmark">5.8.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.2/Benchmark">5.8.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.1/Benchmark">5.8.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.0/Benchmark">5.8.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.2/Benchmark">5.6.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.1/Benchmark">5.6.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.0/Benchmark">5.6.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_04/Benchmark">5.005_04</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_03/Benchmark">5.005_03</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_02/Benchmark">5.005_02</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_01/Benchmark">5.005_01</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005/Benchmark">5.005</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="Benchmark.html#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-dev">
          <a class="dropdown-item" href="https://perldoc.perl.org/blead/Benchmark">blead</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.6/Benchmark">5.39.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.5/Benchmark">5.39.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.4/Benchmark">5.39.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.3/Benchmark">5.39.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.2/Benchmark">5.39.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.1/Benchmark">5.39.1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC2/Benchmark">5.38.0-RC2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC1/Benchmark">5.38.0-RC1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.11/Benchmark">5.37.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.10/Benchmark">5.37.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.9/Benchmark">5.37.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.8/Benchmark">5.37.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.7/Benchmark">5.37.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.6/Benchmark">5.37.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.5/Benchmark">5.37.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.4/Benchmark">5.37.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.3/Benchmark">5.37.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.2/Benchmark">5.37.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.1/Benchmark">5.37.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.0/Benchmark">5.37.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.11/Benchmark">5.35.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.10/Benchmark">5.35.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.9/Benchmark">5.35.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.8/Benchmark">5.35.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.7/Benchmark">5.35.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.6/Benchmark">5.35.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.5/Benchmark">5.35.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.4/Benchmark">5.35.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.3/Benchmark">5.35.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.2/Benchmark">5.35.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.1/Benchmark">5.35.1</a>
          <a class="dropdown-item active" href="Benchmark.html">5.35.0</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="Benchmark.html#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-nav">
          <a class="dropdown-item" href="perl.html">Perl</a>
          <a class="dropdown-item" href="perlintro.html">Intro</a>
          <a class="dropdown-item" href="perl.html#Tutorials">Tutorials</a>
          <a class="dropdown-item" href="perlfaq.html">FAQs</a>
          <a class="dropdown-item" href="perl.html#Reference-Manual">Reference</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlop.html">Operators</a>
          <a class="dropdown-item" href="functions.html">Functions</a>
          <a class="dropdown-item" href="variables.html">Variables</a>
          <a class="dropdown-item" href="modules.html">Modules</a>
          <a class="dropdown-item" href="perlutil.html">Utilities</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlcommunity.html">Community</a>
          <a class="dropdown-item" href="perlhist.html">History</a>
        </div>
      </li>
    </ul>
    <ul class="navbar-nav">
      <script>
        function set_expand (expand) {
          var perldocdiv = document.getElementById('perldocdiv');
          var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width');
          var expanded = (width == '' || width == 'none') ? true : false;
          if (expand === null) {
            expand = !expanded;
          }
          if ((expand && !expanded) || (!expand && expanded)) {
            perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px');
            var button_classlist = document.getElementById('content-expand-button').classList;
            if (expand) {
              button_classlist.add('btn-light');
              button_classlist.remove('btn-outline-light');
            } else {
              button_classlist.add('btn-outline-light');
              button_classlist.remove('btn-light');
            }
          }
          return expand;
        }
        function toggle_expand () {
          var expand = set_expand(null);
          document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC';
        }
        function read_expand () {
          return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 });
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', function () {
            if (read_expand()) {
              set_expand(true);
            }
          });
        } else if (read_expand()) {
          set_expand(true);
        }
      </script>
      <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-2" onclick="toggle_expand()">Expand</button>
    <ul>
    <form class="form-inline" method="get" action="https://perldoc.perl.org/5.35.0/search">
      <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search">
    </form>
  </div>
</nav>

    <div id="wrapperlicious" class="container-fluid">
      <div id="perldocdiv">
        <div id="links">
          <a href="Benchmark.html">Benchmark</a>
          <div id="more">
            (<a href="Benchmark.txt">source</a>,
            <a href="https://metacpan.org/pod/Benchmark">CPAN</a>)
          </div>
            <div id="moduleversion">version 1.23</div>
        </div>
        <div class="leading-notice">
          You are viewing the version of this documentation from Perl 5.35.0.
            This is a development version of Perl.
        </div>
        <h1><a id="toc">CONTENTS</a></h1>
                  <ul>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#NAME">NAME</a>
              </li>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#SYNOPSIS">SYNOPSIS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#DESCRIPTION">DESCRIPTION</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#Methods">Methods</a>
              </li>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#Standard-Exports">Standard Exports</a>
              </li>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#Optional-Exports">Optional Exports</a>
              </li>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#:hireswallclock">:hireswallclock</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#Benchmark-Object">Benchmark Object</a>
              </li>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#NOTES">NOTES</a>
              </li>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#EXAMPLES">EXAMPLES</a>
              </li>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#INHERITANCE">INHERITANCE</a>
              </li>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#CAVEATS">CAVEATS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#SEE-ALSO">SEE ALSO</a>
              </li>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#AUTHORS">AUTHORS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="Benchmark.html#MODIFICATION-HISTORY">MODIFICATION HISTORY</a>
              </li>
          </ul>

      <h1 id="NAME"><a class="permalink" href="Benchmark.html#NAME">#</a>NAME</h1>

<p>Benchmark - benchmark running times of Perl code</p>

<h1 id="SYNOPSIS"><a class="permalink" href="Benchmark.html#SYNOPSIS">#</a>SYNOPSIS</h1>

<pre><code>    use Benchmark qw(:all) ;

    timethis ($count, &quot;code&quot;);

    # Use Perl code in strings...
    timethese($count, {
	&#39;Name1&#39; =&gt; &#39;...code1...&#39;,
	&#39;Name2&#39; =&gt; &#39;...code2...&#39;,
    });

    # ... or use subroutine references.
    timethese($count, {
	&#39;Name1&#39; =&gt; sub { ...code1... },
	&#39;Name2&#39; =&gt; sub { ...code2... },
    });

    # cmpthese can be used both ways as well
    cmpthese($count, {
	&#39;Name1&#39; =&gt; &#39;...code1...&#39;,
	&#39;Name2&#39; =&gt; &#39;...code2...&#39;,
    });

    cmpthese($count, {
	&#39;Name1&#39; =&gt; sub { ...code1... },
	&#39;Name2&#39; =&gt; sub { ...code2... },
    });

    # ...or in two stages
    $results = timethese($count,
        {
	    &#39;Name1&#39; =&gt; sub { ...code1... },
	    &#39;Name2&#39; =&gt; sub { ...code2... },
        },
	&#39;none&#39;
    );
    cmpthese( $results ) ;

    $t = timeit($count, &#39;...other code...&#39;)
    print &quot;$count loops of other code took:&quot;,timestr($t),&quot;\n&quot;;

    $t = countit($time, &#39;...other code...&#39;)
    $count = $t-&gt;iters ;
    print &quot;$count loops of other code took:&quot;,timestr($t),&quot;\n&quot;;

    # enable hires wallclock timing if possible
    use Benchmark &#39;:hireswallclock&#39;;</code></pre>

<h1 id="DESCRIPTION"><a class="permalink" href="Benchmark.html#DESCRIPTION">#</a>DESCRIPTION</h1>

<p>The Benchmark module encapsulates a number of routines to help you figure out how long it takes to execute some code.</p>

<p>timethis - run a chunk of code several times</p>

<p>timethese - run several chunks of code several times</p>

<p>cmpthese - print results of timethese as a comparison chart</p>

<p>timeit - run a chunk of code and see how long it goes</p>

<p>countit - see how many times a chunk of code runs in a given time</p>

<h2 id="Methods"><a class="permalink" href="Benchmark.html#Methods">#</a>Methods</h2>

<dl>

<dt id="new"><a class="permalink" href="Benchmark.html#new">#</a>new</dt>
<dd>

<p>Returns the current time. Example:</p>

<pre><code>use Benchmark;
$t0 = Benchmark-&gt;new;
# ... your code here ...
$t1 = Benchmark-&gt;new;
$td = timediff($t1, $t0);
print &quot;the code took:&quot;,timestr($td),&quot;\n&quot;;</code></pre>

</dd>
<dt id="debug"><a class="permalink" href="Benchmark.html#debug">#</a>debug</dt>
<dd>

<p>Enables or disable debugging by setting the <code>$Benchmark::Debug</code> flag:</p>

<pre><code>Benchmark-&gt;debug(1);
$t = timeit(10, &#39; 5 ** $Global &#39;);
Benchmark-&gt;debug(0);</code></pre>

</dd>
<dt id="iters"><a class="permalink" href="Benchmark.html#iters">#</a>iters</dt>
<dd>

<p>Returns the number of iterations.</p>

</dd>
</dl>

<h2 id="Standard-Exports"><a class="permalink" href="Benchmark.html#Standard-Exports">#</a><a id="Standard"></a>Standard Exports</h2>

<p>The following routines will be exported into your namespace if you use the Benchmark module:</p>

<dl>

<dt id="timeit(COUNT,-CODE)"><a class="permalink" href="Benchmark.html#timeit(COUNT,-CODE)">#</a><a id="timeit"></a><a id="timeit-COUNT-CODE"></a>timeit(COUNT, CODE)</dt>
<dd>

<p>Arguments: COUNT is the number of times to run the loop, and CODE is the code to run. CODE may be either a code reference or a string to be eval&#39;d; either way it will be run in the caller&#39;s package.</p>

<p>Returns: a Benchmark object.</p>

</dd>
<dt id="timethis-(-COUNT,-CODE,-[-TITLE,-[-STYLE-]]-)"><a class="permalink" href="Benchmark.html#timethis-(-COUNT,-CODE,-%5B-TITLE,-%5B-STYLE-%5D%5D-)">#</a><a id="timethis"></a><a id="timethis-COUNT-CODE-TITLE-STYLE"></a>timethis ( COUNT, CODE, [ TITLE, [ STYLE ]] )</dt>
<dd>

<p>Time COUNT iterations of CODE. CODE may be a string to eval or a code reference; either way the CODE will run in the caller&#39;s package. Results will be printed to STDOUT as TITLE followed by the times. TITLE defaults to &quot;timethis COUNT&quot; if none is provided. STYLE determines the format of the output, as described for timestr() below.</p>

<p>The COUNT can be zero or negative: this means the <i>minimum number of CPU seconds</i> to run. A zero signifies the default of 3 seconds. For example to run at least for 10 seconds:</p>

<pre><code>timethis(-10, $code)</code></pre>

<p>or to run two pieces of code tests for at least 3 seconds:</p>

<pre><code class="plaintext">timethese(0, { test1 =&gt; &#39;...&#39;, test2 =&gt; &#39;...&#39;})</code></pre>

<p>CPU seconds is, in UNIX terms, the user time plus the system time of the process itself, as opposed to the real (wallclock) time and the time spent by the child processes. Less than 0.1 seconds is not accepted (-0.01 as the count, for example, will cause a fatal runtime exception).</p>

<p>Note that the CPU seconds is the <b>minimum</b> time: CPU scheduling and other operating system factors may complicate the attempt so that a little bit more time is spent. The benchmark output will, however, also tell the number of <code>$code</code> runs/second, which should be a more interesting number than the actually spent seconds.</p>

<p>Returns a Benchmark object.</p>

</dd>
<dt id="timethese-(-COUNT,-CODEHASHREF,-[-STYLE-]-)"><a class="permalink" href="Benchmark.html#timethese-(-COUNT,-CODEHASHREF,-%5B-STYLE-%5D-)">#</a><a id="timethese"></a><a id="timethese-COUNT-CODEHASHREF-STYLE"></a>timethese ( COUNT, CODEHASHREF, [ STYLE ] )</dt>
<dd>

<p>The CODEHASHREF is a reference to a hash containing names as keys and either a string to eval or a code reference for each value. For each (KEY, VALUE) pair in the CODEHASHREF, this routine will call</p>

<pre><code class="plaintext">timethis(COUNT, VALUE, KEY, STYLE)</code></pre>

<p>The routines are called in string comparison order of KEY.</p>

<p>The COUNT can be zero or negative, see timethis().</p>

<p>Returns a hash reference of Benchmark objects, keyed by name.</p>

</dd>
<dt id="timediff-(-T1,-T2-)"><a class="permalink" href="Benchmark.html#timediff-(-T1,-T2-)">#</a><a id="timediff"></a><a id="timediff-T1-T2"></a>timediff ( T1, T2 )</dt>
<dd>

<p>Returns the difference between two Benchmark times as a Benchmark object suitable for passing to timestr().</p>

</dd>
<dt id="timestr-(-TIMEDIFF,-[-STYLE,-[-FORMAT-]-]-)"><a class="permalink" href="Benchmark.html#timestr-(-TIMEDIFF,-%5B-STYLE,-%5B-FORMAT-%5D-%5D-)">#</a><a id="timestr"></a><a id="timestr-TIMEDIFF-STYLE-FORMAT"></a>timestr ( TIMEDIFF, [ STYLE, [ FORMAT ] ] )</dt>
<dd>

<p>Returns a string that formats the times in the TIMEDIFF object in the requested STYLE. TIMEDIFF is expected to be a Benchmark object similar to that returned by timediff().</p>

<p>STYLE can be any of &#39;all&#39;, &#39;none&#39;, &#39;noc&#39;, &#39;nop&#39; or &#39;auto&#39;. &#39;all&#39; shows each of the 5 times available (&#39;wallclock&#39; time, user time, system time, user time of children, and system time of children). &#39;noc&#39; shows all except the two children times. &#39;nop&#39; shows only wallclock and the two children times. &#39;auto&#39; (the default) will act as &#39;all&#39; unless the children times are both zero, in which case it acts as &#39;noc&#39;. &#39;none&#39; prevents output.</p>

<p>FORMAT is the <a href="http://man.he.net/man3/printf">printf(3)</a>-style format specifier (without the leading &#39;%&#39;) to use to print the times. It defaults to &#39;5.2f&#39;.</p>

</dd>
</dl>

<h2 id="Optional-Exports"><a class="permalink" href="Benchmark.html#Optional-Exports">#</a><a id="Optional"></a>Optional Exports</h2>

<p>The following routines will be exported into your namespace if you specifically ask that they be imported:</p>

<dl>

<dt id="clearcache-(-COUNT-)"><a class="permalink" href="Benchmark.html#clearcache-(-COUNT-)">#</a><a id="clearcache"></a><a id="clearcache-COUNT"></a>clearcache ( COUNT )</dt>
<dd>

<p>Clear the cached time for COUNT rounds of the null loop.</p>

</dd>
<dt id="clearallcache-(-)"><a class="permalink" href="Benchmark.html#clearallcache-(-)">#</a><a id="clearallcache"></a>clearallcache ( )</dt>
<dd>

<p>Clear all cached times.</p>

</dd>
<dt id="cmpthese-(-COUNT,-CODEHASHREF,-[-STYLE-]-)"><a class="permalink" href="Benchmark.html#cmpthese-(-COUNT,-CODEHASHREF,-%5B-STYLE-%5D-)">#</a><a id="cmpthese"></a><a id="cmpthese-COUNT-CODEHASHREF-STYLE"></a>cmpthese ( COUNT, CODEHASHREF, [ STYLE ] )</dt>
<dd>

</dd>
<dt id="cmpthese-(-RESULTSHASHREF,-[-STYLE-]-)"><a class="permalink" href="Benchmark.html#cmpthese-(-RESULTSHASHREF,-%5B-STYLE-%5D-)">#</a><a id="cmpthese1"></a><a id="cmpthese-RESULTSHASHREF-STYLE"></a>cmpthese ( RESULTSHASHREF, [ STYLE ] )</dt>
<dd>

<p>Optionally calls timethese(), then outputs comparison chart. This:</p>

<pre><code>cmpthese( -1, { a =&gt; &quot;++\$i&quot;, b =&gt; &quot;\$i *= 2&quot; } ) ;</code></pre>

<p>outputs a chart like:</p>

<pre><code class="plaintext">       Rate    b    a
b 2831802/s   -- -61%
a 7208959/s 155%   --</code></pre>

<p>This chart is sorted from slowest to fastest, and shows the percent speed difference between each pair of tests.</p>

<p><code>cmpthese</code> can also be passed the data structure that timethese() returns:</p>

<pre><code>$results = timethese( -1,
    { a =&gt; &quot;++\$i&quot;, b =&gt; &quot;\$i *= 2&quot; } ) ;
cmpthese( $results );</code></pre>

<p>in case you want to see both sets of results. If the first argument is an unblessed hash reference, that is RESULTSHASHREF; otherwise that is COUNT.</p>

<p>Returns a reference to an ARRAY of rows, each row is an ARRAY of cells from the above chart, including labels. This:</p>

<pre><code>my $rows = cmpthese( -1,
    { a =&gt; &#39;++$i&#39;, b =&gt; &#39;$i *= 2&#39; }, &quot;none&quot; );</code></pre>

<p>returns a data structure like:</p>

<pre><code class="plaintext">[
    [ &#39;&#39;,       &#39;Rate&#39;,   &#39;b&#39;,    &#39;a&#39; ],
    [ &#39;b&#39;, &#39;2885232/s&#39;,  &#39;--&#39;, &#39;-59%&#39; ],
    [ &#39;a&#39;, &#39;7099126/s&#39;, &#39;146%&#39;,  &#39;--&#39; ],
]</code></pre>

<p><b>NOTE</b>: This result value differs from previous versions, which returned the <code>timethese()</code> result structure. If you want that, just use the two statement <code>timethese</code>...<code>cmpthese</code> idiom shown above.</p>

<p>Incidentally, note the variance in the result values between the two examples; this is typical of benchmarking. If this were a real benchmark, you would probably want to run a lot more iterations.</p>

</dd>
<dt id="countit(TIME,-CODE)"><a class="permalink" href="Benchmark.html#countit(TIME,-CODE)">#</a><a id="countit"></a><a id="countit-TIME-CODE"></a>countit(TIME, CODE)</dt>
<dd>

<p>Arguments: TIME is the minimum length of time to run CODE for, and CODE is the code to run. CODE may be either a code reference or a string to be eval&#39;d; either way it will be run in the caller&#39;s package.</p>

<p>TIME is <i>not</i> negative. countit() will run the loop many times to calculate the speed of CODE before running it for TIME. The actual time run for will usually be greater than TIME due to system clock resolution, so it&#39;s best to look at the number of iterations divided by the times that you are concerned with, not just the iterations.</p>

<p>Returns: a Benchmark object.</p>

</dd>
<dt id="disablecache-(-)"><a class="permalink" href="Benchmark.html#disablecache-(-)">#</a><a id="disablecache"></a>disablecache ( )</dt>
<dd>

<p>Disable caching of timings for the null loop. This will force Benchmark to recalculate these timings for each new piece of code timed.</p>

</dd>
<dt id="enablecache-(-)"><a class="permalink" href="Benchmark.html#enablecache-(-)">#</a><a id="enablecache"></a>enablecache ( )</dt>
<dd>

<p>Enable caching of timings for the null loop. The time taken for COUNT rounds of the null loop will be calculated only once for each different COUNT used.</p>

</dd>
<dt id="timesum-(-T1,-T2-)"><a class="permalink" href="Benchmark.html#timesum-(-T1,-T2-)">#</a><a id="timesum"></a><a id="timesum-T1-T2"></a>timesum ( T1, T2 )</dt>
<dd>

<p>Returns the sum of two Benchmark times as a Benchmark object suitable for passing to timestr().</p>

</dd>
</dl>

<h2 id=":hireswallclock"><a class="permalink" href="Benchmark.html#:hireswallclock">#</a><a id="hireswallclock"></a>:hireswallclock</h2>

<p>If the Time::HiRes module has been installed, you can specify the special tag <code>:hireswallclock</code> for Benchmark (if Time::HiRes is not available, the tag will be silently ignored). This tag will cause the wallclock time to be measured in microseconds, instead of integer seconds. Note though that the speed computations are still conducted in CPU time, not wallclock time.</p>

<h1 id="Benchmark-Object"><a class="permalink" href="Benchmark.html#Benchmark-Object">#</a><a id="Benchmark"></a>Benchmark Object</h1>

<p>Many of the functions in this module return a Benchmark object, or in the case of <code>timethese()</code>, a reference to a hash, the values of which are Benchmark objects. This is useful if you want to store or further process results from Benchmark functions.</p>

<p>Internally the Benchmark object holds timing values, described in <a href="Benchmark.html#NOTES">&quot;NOTES&quot;</a> below. The following methods can be used to access them:</p>

<dl>

<dt id="cpu_p"><a class="permalink" href="Benchmark.html#cpu_p">#</a>cpu_p</dt>
<dd>

<p>Total CPU (User + System) of the main (parent) process.</p>

</dd>
<dt id="cpu_c"><a class="permalink" href="Benchmark.html#cpu_c">#</a>cpu_c</dt>
<dd>

<p>Total CPU (User + System) of any children processes.</p>

</dd>
<dt id="cpu_a"><a class="permalink" href="Benchmark.html#cpu_a">#</a>cpu_a</dt>
<dd>

<p>Total CPU of parent and any children processes.</p>

</dd>
<dt id="real"><a class="permalink" href="Benchmark.html#real">#</a>real</dt>
<dd>

<p>Real elapsed time &quot;wallclock seconds&quot;.</p>

</dd>
<dt id="iters1"><a class="permalink" href="Benchmark.html#iters1">#</a>iters</dt>
<dd>

<p>Number of iterations run.</p>

</dd>
</dl>

<p>The following illustrates use of the Benchmark object:</p>

<pre><code>$result = timethis(100000, sub { ... });
print &quot;total CPU = &quot;, $result-&gt;cpu_a, &quot;\n&quot;;</code></pre>

<h1 id="NOTES"><a class="permalink" href="Benchmark.html#NOTES">#</a>NOTES</h1>

<p>The data is stored as a list of values from the time and times functions:</p>

<pre><code>($real, $user, $system, $children_user, $children_system, $iters)</code></pre>

<p>in seconds for the whole loop (not divided by the number of rounds).</p>

<p>The timing is done using time(3) and times(3).</p>

<p>Code is executed in the caller&#39;s package.</p>

<p>The time of the null loop (a loop with the same number of rounds but empty loop body) is subtracted from the time of the real loop.</p>

<p>The null loop times can be cached, the key being the number of rounds. The caching can be controlled using calls like these:</p>

<pre><code>clearcache($key);
clearallcache();

disablecache();
enablecache();</code></pre>

<p>Caching is off by default, as it can (usually slightly) decrease accuracy and does not usually noticeably affect runtimes.</p>

<h1 id="EXAMPLES"><a class="permalink" href="Benchmark.html#EXAMPLES">#</a>EXAMPLES</h1>

<p>For example,</p>

<pre><code>use Benchmark qw( cmpthese ) ;
$x = 3;
cmpthese( -5, {
    a =&gt; sub{$x*$x},
    b =&gt; sub{$x**2},
} );</code></pre>

<p>outputs something like this:</p>

<pre><code class="plaintext">Benchmark: running a, b, each for at least 5 CPU seconds...
       Rate    b    a
b 1559428/s   -- -62%
a 4152037/s 166%   --</code></pre>

<p>while</p>

<pre><code>use Benchmark qw( timethese cmpthese ) ;
$x = 3;
$r = timethese( -5, {
    a =&gt; sub{$x*$x},
    b =&gt; sub{$x**2},
} );
cmpthese $r;</code></pre>

<p>outputs something like this:</p>

<pre><code class="plaintext">Benchmark: running a, b, each for at least 5 CPU seconds...
         a: 10 wallclock secs ( 5.14 usr +  0.13 sys =  5.27 CPU) @ 3835055.60/s (n=20210743)
         b:  5 wallclock secs ( 5.41 usr +  0.00 sys =  5.41 CPU) @ 1574944.92/s (n=8520452)
       Rate    b    a
b 1574945/s   -- -59%
a 3835056/s 144%   --</code></pre>

<h1 id="INHERITANCE"><a class="permalink" href="Benchmark.html#INHERITANCE">#</a>INHERITANCE</h1>

<p>Benchmark inherits from no other class, except of course from Exporter.</p>

<h1 id="CAVEATS"><a class="permalink" href="Benchmark.html#CAVEATS">#</a>CAVEATS</h1>

<p>Comparing eval&#39;d strings with code references will give you inaccurate results: a code reference will show a slightly slower execution time than the equivalent eval&#39;d string.</p>

<p>The real time timing is done using time(2) and the granularity is therefore only one second.</p>

<p>Short tests may produce negative figures because perl can appear to take longer to execute the empty loop than a short test; try:</p>

<pre><code>timethis(100,&#39;1&#39;);</code></pre>

<p>The system time of the null loop might be slightly more than the system time of the loop with the actual code and therefore the difference might end up being &lt; 0.</p>

<h1 id="SEE-ALSO"><a class="permalink" href="Benchmark.html#SEE-ALSO">#</a><a id="SEE"></a>SEE ALSO</h1>

<p><a href="./Devel::NYTProf.html">Devel::NYTProf</a> - a Perl code profiler</p>

<h1 id="AUTHORS"><a class="permalink" href="Benchmark.html#AUTHORS">#</a>AUTHORS</h1>

<p>Jarkko Hietaniemi &lt;<i>jhi@iki.fi</i>&gt;, Tim Bunce &lt;<i>Tim.Bunce@ig.co.uk</i>&gt;</p>

<h1 id="MODIFICATION-HISTORY"><a class="permalink" href="Benchmark.html#MODIFICATION-HISTORY">#</a><a id="MODIFICATION"></a>MODIFICATION HISTORY</h1>

<p>September 8th, 1994; by Tim Bunce.</p>

<p>March 28th, 1997; by Hugo van der Sanden: added support for code references and the already documented &#39;debug&#39; method; revamped documentation.</p>

<p>April 04-07th, 1997: by Jarkko Hietaniemi, added the run-for-some-time functionality.</p>

<p>September, 1999; by Barrie Slaymaker: math fixes and accuracy and efficiency tweaks. Added cmpthese(). A result is now returned from timethese(). Exposed countit() (was runfor()).</p>

<p>December, 2001; by Nicholas Clark: make timestr() recognise the style &#39;none&#39; and return an empty string. If cmpthese is calling timethese, make it pass the style in. (so that &#39;none&#39; will suppress output). Make sub new dump its debugging output to STDERR, to be consistent with everything else. All bugs found while writing a regression test.</p>

<p>September, 2002; by Jarkko Hietaniemi: add &#39;:hireswallclock&#39; special tag.</p>

<p>February, 2004; by Chia-liang Kao: make cmpthese and timestr use time statistics for children instead of parent when the style is &#39;nop&#39;.</p>

<p>November, 2007; by Christophe Grosjean: make cmpthese and timestr compute time consistently with style argument, default is &#39;all&#39; not &#39;noc&#39; any more.</p>


      </div>
      <div id="footer">
        <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p>

<p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p>


      </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <script src="../highlight.pack.js"></script>
    <script>hljs.highlightAll();</script>
  </body>
</html>
